package com.yuw.oop.polymorphicdemo4;

public class Dog extends Animal {
	
	/**
	 * 进食行为
	 */
	
	public void doEating() {
		System.out.println(this.animalName+"is eating bone....");
		//可以通过super调用父类的属性和行为方法
		System.out.println("父类原始udall吃饭方式：");
		super.doEating();
		
	
	}
	
	@Override
	public void doSleeping() {
		
		super.doSleeping();
		
	}

	/**
	 * 抓老鼠行为
	 */
	public void doCatching() {
		System.out.println(this.getAnimalName()+"catched a jarry...");
		super.doEating();
		doEating();
		
	}
	

}
